package edu.uwaterloo.bicyclecomputer.modefunctions;

//import edu.uwaterloo.bicyclecomputer.SystemValues;

public class tm {

	public static int value;
	public static final String name = "tm";
	public static boolean error = false;
	public static boolean overflow = false;
	public static boolean invisible = false;
	
	public static void calculate() {
		if (error) return;
		if (false)  {
			error = true;
			return;
		}
		try {
			if (true) {
				value = (int) (tm.value + 1);
				checkValue();
			}
		}
		catch (Exception _e) {
			error = true;
			return;
		}
	}
	
	private static void checkValue() {
		if (value >= 36000) {
			value -=36000;
			overflow = true;
		}

	}
	
	public static String getString() {
		if (error) return "E";
		int hr = value / 3600;
		int min = (value - (hr*3600)) / 60;
		int sec = (value - (hr*3600) - (min*60));
		return String.valueOf(hr) + ":" + String.format("%02d", min) + ":" + String.format("%02d", sec);
	}
}
